<template>
  <div>
    <div>
      <ul>
        <li><router-link to="/tyhome">All_contacts</router-link></li>
        <li><router-link to="/tynews">Alice</router-link></li>
        <li><router-link to="/gwsports">Bob</router-link></li>
      </ul>
    </div> 
    <button @click="clickFn">随机显示</button>
    <div>
      <router-view></router-view>
    </div>
   
  </div>
</template>

<script>
export default {
  methods:{
    clickFn(){
      const arr=['tyhome','tynews','gwsports']
      let num = parseInt(Math.random()*3)
      this.$router.push({
        name:arr[num]
      })
    }
  }
};
</script>

<style>
</style>